<?php
GLOBAL $AppUI, $canRead, $canEdit;

$project_id = dPgetParam($_REQUEST, 'project_id', 0);

$df = $AppUI->getPref('SHDATEFORMAT');

require_once(DP_BASE_DIR."/modules/projects/items/projectitems.class.php");
if (!$canRead) {            // lock out users that do not have at least readPermission on this module
    $AppUI->redirect( "m=public&a=access_denied" );
    exit;
}
// retrieving some dynamic content using an easy database query
// add/show now gradually the einstein quotes
$project_itemsObj = new CMdProject_items();
$q = new DBQuery();
$project_items = $project_itemsObj->simpleLoadProjectItemsByProject($project_id);

header('Content-Type: text/xml');

$xml = new XmlWriter();
$xml->openMemory();
$xml->startDocument('1.0', 'UTF-8');

$xml->startElement('root');

obj2xml($xml, 'pitems', 'item', $project_items);

$xml->endElement();

echo $xml->outputMemory(true);
?>